{% extends "admin/home.html" %}
{% block name %}
    管理员： {{ id }}
{% endblock %}

{% block content %}
    {% include "admin/menu.html" %}
    <div>
        {% for msg in get_flashed_messages(category_filter=["ok"]) %}
            <div class="alert alert-success alert-dismissible">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×
                </button>
                <h4><i class="icon fa fa-check"></i> 操作成功</h4>
                {{ msg }}
            </div>
        {% endfor %}
        <div style="width: auto">
            <body>
            <table class="table">
                <thead>
                <tr>
                    <th>用户id</th>
                    <th>用户名</th>
                    <th>用户邮箱</th>
                    <th>用户电话</th>
                    <th>用户状态</th>
                    <th>账户余额</th>
                    <th>会员截止时间</th>
                    <th>注销账户</th>
                </tr>
                </thead>
                <tbody>
                {% for v in form %}

                    {% if v.vclass == 1 %}
                        <tr class="warning">
                            {% elif v.vclass < 0  %}
                        <tr class="danger">
                            {% else %}
                        <tr class="">
                    {% endif %}
                <td>{{ v.id }}</td>
                <td>{{ v.name }}</td>
                <td>{{ v.email }}</td>
                <td>{{ v.phone }}</td>
                {% if v.vclass == 1 %}
                    <td>订阅会员</td>
                {% elif v.vclass < 0 %}
                    <td>已经注销</td>
                {% else %}
                    <td> -</td>
                {% endif %}
                <td>{{ v.wallet }}</td>
                {% if v.vclass == 1 %}
                    <td>{{ v.end }}</td>
                {% else %}
                    <td>- - -</td>
                {% endif %}


                {% if v.vclass <0  %}

                    <td><a target="_self" href="{{ url_for('admin.reuser',id=v.id) }}"
                           style="color: red">&nbsp;恢复</a></td>
                {% else %}

                    <td><a target="_self" href="{{ url_for('admin.deuser',id=v.id) }}"
                           style="color: red">&nbsp;注销</a></td>
                {% endif %}

                </tr>
                {% endfor %}
            </table>
            </body>
        </div>
    </div>
    </div>
{% endblock %}

{% block js %}
    <script>
        $(document).ready(function () {
            $("#m2").addClass("active");
        })
    </script>
{% endblock %}